package com.tongzhan.base;

//import com.tongzhan.repository.NewPersonRepository;

import com.tongzhan.entity.User;
import com.tongzhan.repository.*;
import com.tongzhan.repository.religion.DutiesRepository;
import com.tongzhan.service.MarkPromptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Query;

/**
 * @author hongjianbin
 * @date 2020/7/14
 */
public class BaseShareService {
    //    @Autowired
//    public RedisUtils redisUtils;
    @Autowired
    public UserRepository userRepository;
    @Autowired
    public DutiesRepository dutiesRepository;
    @Autowired
    public FengcaiRepository fengcaiRepository;
    @Autowired
    public BrandRepository brandRepository;
    @Autowired
    public ExamplePointRepository examplePointRepository;
    @Autowired
    public UserInfoRepository userInfoRepository;
    @Autowired
    public ActionCenterRepository actionCenterRepository;
    @Autowired
    public ParticipationRepository ParticipationRepository;
    @Autowired
    public DiscussRepository discussRepository;
    @Autowired
    public ReplyRepository replyRepository;

    @Autowired
    public MarkPromptService markPromptService;

    public User findUserById(String userId) {
//        User user = userRepository.findByPrimaryKey(userId);
        User user = userRepository.findOne(new Query().addCriteria(BaseCriteria.where("UserId").is(userId).and("IsDelete").is(0)));
        return user;
    }
}
